<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>精灵动画-逐帧动画</title>
    <style>
        .main {
            width: 140px;
            height: 140px;
            background-image: url(./assets/bg.png);
            background-repeat: no-repeat;
            background-size: cover;
            animation: run 1s steps(12) infinite, move 3s linear forwards;
        }
        /* 当动画开始状态样式和默认样式一样时，可忽略开始动画开始状态 */
        
        @keyframes run {
            /* from {
                background-position: 0 0;
            } */
            to {
                background-position: -1680px 0;
            }
        }
        
        @keyframes move {
            /* from {
                transform: translateX(0px);
            } */
            to {
                transform: translateX(800px);
            }
        }
    </style>
</head>

<body>
    <div class="main">

    </div>
</body>

</html>